x, y, z = map(int, input().split())
room = [0 for i in range(z+1)]

room[1] = room[2] =1
if x ==2:
    room[2] = 0

for i in range(3,z+1):
    if i != x and i != y:
        room[i] = room[i-1] + room[i-2]
    else:
        room[i] = 0

print(room[z])